#pragma once

#include <IXCombo.h>
#include "XHwndImpl.h"



template <class I>
class CXComboImpl : public CXHwndImpl<I>
{
    typedef CXHwndImpl<I> superclass;

    BEGIN_DEF_SKIN_CLASS(CXCombo, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXCombo,    0)
    END_DEF_SKIN_CLASS();

    IMPL_CONTROL_OBJ(CXComboImpl, superclass, _T("Combo"));

public:
    CXComboImpl();
    virtual ~CXComboImpl();

public:
    // IXHwnd
    virtual DWORD   STDMETHODCALLTYPE   GetHwndFlags();
    virtual BOOL    STDMETHODCALLTYPE   OnCommand(UINT command);
    virtual HRESULT STDMETHODCALLTYPE   get_Text(IN BSTR* bstrText);

public:
    // IXCombo
    virtual int     STDMETHODCALLTYPE   get_ItemCount();

    virtual int     STDMETHODCALLTYPE   get_CurSel();
    virtual void    STDMETHODCALLTYPE   put_CurSel(IN int nCurSel);

    virtual int     STDMETHODCALLTYPE   get_MinVisibleItemCount();
    virtual void    STDMETHODCALLTYPE   put_MinVisibleItemCount(IN int nCount);

    virtual int     STDMETHODCALLTYPE   AddString(IN LPCTSTR szText);
    virtual int     STDMETHODCALLTYPE   InsertString(IN int uIndex, LPCTSTR szText);
    virtual int     STDMETHODCALLTYPE   DeleteString(IN int uIndex);

    virtual DWORD   STDMETHODCALLTYPE   get_ItemData(IN int nIndex);
    virtual void    STDMETHODCALLTYPE   put_ItemData(IN int nIndex, IN DWORD dwItemData);

protected:
    // CXHwndImpl Callback
    virtual XString GetHwndClassName();

    // CXControlImpl
    virtual HRESULT OnSkinLangChanged();
};


class CXCombo : public CXComboImpl<IXCombo>
{
};
